package com.cssy.xxkj.logic.dao.impl;

import java.util.List;
import java.util.Map;

import org.springframework.dao.DataAccessException;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.cssy.xxkj.logic.dao.LogicPurchaseReturnItemDAO;
import com.cssy.xxkj.logic.entity.LogicPurchaseReturnItemDO;
import com.plat.exception.SyBaseException;
import com.plat.helper.SearchConditions;

/**
 * 数据访问对象实现类
 * @since 2014-09-23
 */
public class LogicPurchaseReturnItemDAOImpl extends SqlMapClientDaoSupport implements LogicPurchaseReturnItemDAO {

    /**
     * 插入数据
     * @param logicPurchaseReturnItemDO
     * @return 插入数据的主键
     */
    public String insertLogicPurchaseReturnItemDO(LogicPurchaseReturnItemDO logicPurchaseReturnItemDO) {
        Object id = getSqlMapClientTemplate().insert("LogicPurchaseReturnItem.insert", logicPurchaseReturnItemDO);
        return (String)id;
    }
    
    @Override
	public Integer updateLogicPurchaseReturnItemDO(
			LogicPurchaseReturnItemDO pcsrItemDO) throws DataAccessException {
    	int result = getSqlMapClientTemplate().update("LogicPurchaseReturnItem.update", pcsrItemDO);
        return result;
	}
    
    @Override
    public Integer deleteLogicPurchaseReturnItemDOByPrimaryKey(String id)throws DataAccessException{
    	int row = getSqlMapClientTemplate().update("LogicPurchaseReturnItem.deleteByPrimaryKey", id);
    	return row;
    }

    /**
     * 统计记录数
     * @param logicPurchaseReturnItemDO
     * @return 查出的记录数
     */
    public Integer countLogicPurchaseReturnItemDOByExample(LogicPurchaseReturnItemDO logicPurchaseReturnItemDO) {
        Integer count = (Integer) getSqlMapClientTemplate().queryForObject("LogicPurchaseReturnItem.countByDOExample", logicPurchaseReturnItemDO);
        return count;
    }

    /**
     * 获取对象列表
     * @param logicPurchaseReturnItemDO
     * @return 对象列表
     */
    @SuppressWarnings("unchecked")
    public List<LogicPurchaseReturnItemDO> findListByExample(LogicPurchaseReturnItemDO logicPurchaseReturnItemDO) {
        List<LogicPurchaseReturnItemDO> list = getSqlMapClientTemplate().queryForList("LogicPurchaseReturnItem.findListByDO", logicPurchaseReturnItemDO);
        return list;
    }

	@Override
	public List<LogicPurchaseReturnItemDO> findListByMap(
			Map<String, Object> paramMap) throws SyBaseException {
		return getSqlMapClientTemplate().queryForList("LogicPurchaseReturnItem_ex.findListByMap", paramMap);
	}

	@Override
	public List<LogicPurchaseReturnItemDO> find(SearchConditions scs)
			throws DataAccessException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Integer count(SearchConditions scs) throws DataAccessException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Integer deleteBizRemoved(String id) throws DataAccessException {
		// TODO Auto-generated method stub
		return null;
	}

}